<%require 'htmlentities'
coder = HTMLEntities.new
%>


<div class="column-two-heading">Latest on SearchMyCampus</div>
    <%@all_categories.each do |category| -%>
      <%if category.name!='Events' -%>
      <div class="column-boxes">

           <div class="post-tabs-heads">
                	<ul>
                        <li class="post-tabs-selected"><a href="" ><%=h category.name -%></a></li>
                    </ul>
          </div>
          <% @ads = category.advertisments.find(:all, :limit => 3, :order=>"created_at DESC") %>
          <div class="post-tabs-posts">
          <ul>
            <%@ads.each do |ad|%>
             <% @sub_category_name=SubCategory.find(ad.sub_category_id).name -%>

               <li>
                  <div class="latest-post-ads">
<%if ad.title? %>
		                    	<div class="latest-post-ads-headings">
                               		<%= link_to h(coder.decode(excerpt(ad.title.humanize , '', 30))), {:controller =>"advertisments", :action=>"show" , :id=> ad.id } -%>

                                </div>
<%end -%>
			                   	<div class="latest-post-ads-sub">
                                	<%=category.name-%>/<%=@sub_category_name-%>
                                </div>
                                <div class="latest-post-ads-date">
                                	<%= ad.created_at.to_formatted_s(:long_ordinal) %>
                                </div>
				</div>
               </li>

               <%end%>

            </ul>
               <div class="more-ads">
                    	<div class="more-ads-text">
                        	More
                        </div>
                        <div class="more-ads-image">
                        	<img src="images/more-ads.png" width="6"/>
                        </div>
                </div>
          </div>
       </div>
      <%end -%>
      <%end%>
  <div style="clear:both;">&nbsp;</div>
	    	